package com.idefav.feignconsumer.Controllers;

import com.idefav.feignconsumer.Services.HelloService;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/hello")
public class ConsumerController {

    @Autowired
    private HelloService helloService;

    @RequestMapping("/say/{test}")
    @HystrixCommand
    public String Helloconsumer(@PathVariable("test") String test){
        return helloService.say(test);
    }
}
